package jafou.Model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;
import com.google.storage.onestore.v3.OnestoreEntity.Reference;

@PersistenceCapable
public class Topic {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String subject;
	
	@Persistent
	private Date createdOn;
	
	@Persistent
	private String userId;
	
	@Persistent
	private boolean isDeleted;
	
	@Persistent
	private int nComments;
	
	@Persistent
	private String forumId;
	
	@Persistent
	private String userIP;
	
	public Topic(String userId, String userIP, String forumId) {
		this.userId = userId;
		this.userIP = userIP;
		this.forumId = forumId;
		this.createdOn = new Date();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public Date getCreatedOn() {
		return createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public String getUserId() {
		return userId;
	}

	public boolean isDeleted() {
		return isDeleted;
	}

	public void setDeleted(boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	public int getNComments() {
		return nComments;
	}

	public void setNComments(int comments) {
		nComments = comments;
	}

	public String getForumId() {
		return forumId;
	}

	public String getUserIP() {
		return userIP;
	}
	
}
